package org.anti996.ln_mybatis.model;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.Version;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

/**
 * <p>
 * 账户表
 * </p>
 *
 * @author Anti996 Authors
 * @since 2022-07-11
 */
@Data
@ToString
@ApiModel(value = "Account对象", description = "账户表")
public class Account implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("用户名")
    private String username;

    @ApiModelProperty("密码")
    private String passwd;

    @ApiModelProperty("姓名")
    private String name;

    @ApiModelProperty("身份证号")
    private String idnumber;

    @ApiModelProperty("籍贯")
    @TableField(fill = FieldFill.INSERT)  // 测试自动填充
    private String hometown;

    @ApiModelProperty("预留手机号")
    private String phone;

    @ApiModelProperty("开户日期")
    private LocalDateTime accountOpen;

    @ApiModelProperty("销户日期")
    @TableLogic(value = "null", delval = "now()")
    private LocalDateTime accountClose;

    @ApiModelProperty("乐观锁")
    @Version
    private Integer version;
}
